# -*- coding: utf8 -*-
# -*- version: 3.12.2 -*-
# -*- date: 2024-6-13 -*-
# 字符串相关的处理

def clear_input(ipt: str) -> str:
    """
    清理用户输出的字符串
    """
    str_len = len(ipt)
    if str_len > 1:
        first = ipt[:1]
        end = ipt[str_len - 1:]
        if first != end:
            return ipt

        if first == '"' or first == "'":
            ipt = ipt[1:str_len - 1].strip()

    return ipt
